package com.kim.smartring.net.business;

import com.kim.smartring.db.model.User;
import com.kim.smartring.net.ACommunication;
import com.kim.smartring.net.AEntity;
import com.kim.smartring.net.IReceiverListener;
import com.kim.smartring.net.entity.UpdateUserInfoEntity;
import com.kim.smartring.net.impl.PostCommunication;

import android.content.Context;

public class UpdateUserInfoBusiness {

	public interface UpdateUserInfoCallback {
		void updateSuccess();

		void updateFail();
	}

	public static void updateUserInfo(Context context, User user,
			UpdateUserInfoCallback callback) {
		
		UpdateUserInfoEntity entity = new UpdateUserInfoEntity(context, user,
				new IReceiverListener() {

					@Override
					public void onReceive(AEntity entity) {

					}
				});
		final ACommunication comm = new PostCommunication(entity);
		new Thread(new Runnable() {

			@Override
			public void run() {
				try {
					comm.sendEntity();
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		}).start();
	}
}
